<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NeuZephyr: D:/Users/Mgepahmge/Documents/C Program/NeuZephyr/include/NeuZephyr/Dimension.cuh Source File</title>
<link rel="icon" href="NZ_logo2.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="NZ_logo2.png"/></td>
  <td id="projectalign">
   <div id="projectname">NeuZephyr
   </div>
   <div id="projectbrief">Simple DL Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_a7e6ee1ae3f772c9504a0b543f2027e2.html">Mgepahmge</a></li><li class="navelem"><a class="el" href="dir_e03f57e346cc4845a4c354a35630b169.html">Documents</a></li><li class="navelem"><a class="el" href="dir_231a0482af2b83c895f27ba7fe745141.html">C Program</a></li><li class="navelem"><a class="el" href="dir_0fa7fc3a0dfd304dbfc9dce9f6facfa2.html">NeuZephyr</a></li><li class="navelem"><a class="el" href="dir_e7295b03dab2e9cdf32139bd8ec2e607.html">include</a></li><li class="navelem"><a class="el" href="dir_657344ecc65cfc28732701509f8d8421.html">NeuZephyr</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">Dimension.cuh</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#ifndef DIMENSION_CUH</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="preprocessor">#define DIMENSION_CUH</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;stdexcept&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#include &quot;dl_export.cuh&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="foldopen" id="foldopen00009" data-start="{" data-end="}">
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="namespacenz_1_1data.html">    9</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacenz_1_1data.html">nz::data</a> {</div>
<div class="foldopen" id="foldopen00057" data-start="{" data-end="};">
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classnz_1_1data_1_1_dimension.html">   57</a></span>    <span class="keyword">class </span>DL_API <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a> {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>        <span class="keyword">friend</span> DL_API std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; dim);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>        <span class="keyword">friend</span> DL_API std::istream&amp; operator&gt;&gt;(std::istream&amp; is, <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; dim);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>        <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>(<span class="keywordtype">size_t</span> n, <span class="keywordtype">size_t</span> c, <span class="keywordtype">size_t</span> h, <span class="keywordtype">size_t</span> w);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>        <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>();</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span>        <span class="keyword">explicit</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>(<span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; dims);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>        <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; other);</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span>        <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; operator=(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; other);</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span> </div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>        [[nodiscard]] <span class="keywordtype">size_t</span> size() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span> </div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno">  299</span>        [[nodiscard]] <span class="keywordtype">size_t</span> getStride(<span class="keywordtype">size_t</span> i) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span> </div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>        [[nodiscard]] std::vector&lt;size_t&gt; getDims() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span> </div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span>        [[nodiscard]] <span class="keywordtype">size_t</span> N() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno">  369</span> </div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno">  400</span>        [[nodiscard]] <span class="keywordtype">size_t</span> C() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno">  401</span> </div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno">  432</span>        [[nodiscard]] <span class="keywordtype">size_t</span> H() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno">  433</span> </div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span>        [[nodiscard]] <span class="keywordtype">size_t</span> W() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span> </div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span>        [[nodiscard]] <span class="keywordtype">size_t</span>&amp; operator[](<span class="keywordtype">size_t</span> i);</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span> </div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno">  532</span>        [[nodiscard]] <span class="keyword">const</span> <span class="keywordtype">size_t</span>&amp; operator[](<span class="keywordtype">size_t</span> i) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno">  533</span> </div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno">  566</span>        <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno">  567</span> </div>
<div class="line"><a id="l00600" name="l00600"></a><span class="lineno">  600</span>        [[nodiscard]] <span class="keywordtype">bool</span> isBroadcastCompatible(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno">  601</span> </div>
<div class="line"><a id="l00639" name="l00639"></a><span class="lineno">  639</span>        <span class="keywordtype">bool</span> reshape(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; newShape);</div>
<div class="line"><a id="l00640" name="l00640"></a><span class="lineno">  640</span> </div>
<div class="line"><a id="l00676" name="l00676"></a><span class="lineno">  676</span>        <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00677" name="l00677"></a><span class="lineno">  677</span> </div>
<div class="line"><a id="l00717" name="l00717"></a><span class="lineno">  717</span>        [[nodiscard]] <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a> Broadcast(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Dimension</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00718" name="l00718"></a><span class="lineno">  718</span> </div>
<div class="line"><a id="l00749" name="l00749"></a><span class="lineno">  749</span>        <span class="keywordtype">void</span> updateStride();</div>
<div class="line"><a id="l00750" name="l00750"></a><span class="lineno">  750</span> </div>
<div class="line"><a id="l00751" name="l00751"></a><span class="lineno">  751</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00752" name="l00752"></a><span class="lineno">  752</span>        <span class="keywordtype">size_t</span> n;</div>
<div class="line"><a id="l00753" name="l00753"></a><span class="lineno">  753</span>        <span class="keywordtype">size_t</span> c;</div>
<div class="line"><a id="l00754" name="l00754"></a><span class="lineno">  754</span>        <span class="keywordtype">size_t</span> h;</div>
<div class="line"><a id="l00755" name="l00755"></a><span class="lineno">  755</span>        <span class="keywordtype">size_t</span> w;</div>
<div class="line"><a id="l00756" name="l00756"></a><span class="lineno">  756</span>        <span class="keywordtype">size_t</span> stride[4];</div>
<div class="line"><a id="l00757" name="l00757"></a><span class="lineno">  757</span> </div>
<div class="line"><a id="l00758" name="l00758"></a><span class="lineno">  758</span>        <span class="keyword">static</span> <span class="keywordtype">bool</span> checkIndex(<span class="keyword">const</span> <span class="keywordtype">size_t</span> i) {</div>
<div class="line"><a id="l00759" name="l00759"></a><span class="lineno">  759</span>            <span class="keywordflow">return</span> i &lt; 4;</div>
<div class="line"><a id="l00760" name="l00760"></a><span class="lineno">  760</span>        }</div>
<div class="line"><a id="l00761" name="l00761"></a><span class="lineno">  761</span>    };</div>
</div>
<div class="line"><a id="l00762" name="l00762"></a><span class="lineno">  762</span>}</div>
</div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno">  763</span> </div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno">  764</span> </div>
<div class="line"><a id="l00765" name="l00765"></a><span class="lineno">  765</span><span class="preprocessor">#endif </span><span class="comment">//DIMENSION_CUH</span></div>
<div class="ttc" id="aclassnz_1_1data_1_1_dimension_html"><div class="ttname"><a href="classnz_1_1data_1_1_dimension.html">nz::data::Dimension</a></div><div class="ttdoc">Represents a multi - dimensional shape, typically used in deep learning for tensor dimensions.</div><div class="ttdef"><b>Definition</b> <a href="#l00057">Dimension.cuh:57</a></div></div>
<div class="ttc" id="anamespacenz_1_1data_html"><div class="ttname"><a href="namespacenz_1_1data.html">nz::data</a></div><div class="ttdoc">Contains data structures and utilities for tensor operations in machine learning workflows.</div><div class="ttdef"><b>Definition</b> <a href="#l00009">Dimension.cuh:9</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
